		<?php $siteName = cr('cmsConfig.Backend.siteName')?>

<div class="block">
   <!-- start of header -->
   <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f4f5" id="backgroundTable" st-sortable="header">
      <tbody>
         <tr>
            <td>
               <table width="612" cellspacing="0" cellpadding="0" border="0" bgcolor="#0db9ea" align="center" class="devicewidth" hlitebg="edit" shadow="edit">
                  <tbody>
                     <tr>
                        <td>
                           <!-- logo -->
                           <table width="612" cellspacing="0" cellpadding="0" border="0" align="left" class="devicewidth">
                              <tbody>
                                 <tr>
                                    <td width="612" valign="middle" style="font-family: Helvetica, Arial, sans-serif;font-size: 14px; color: #ffffff;line-height: 24px; padding: 10px 0 10px 20px;" class="logo">
                                       <div class="imgpop">
                                          <a href="#"  style="text-decoration: none; color: #ffffff;"><h3><?php echo $siteName; ?></h3></a>
                                       </div>
                                    </td>
                                 </tr>
                              </tbody>
                           </table>
                           <!-- End of logo -->
                           <!-- menu -->
                           
                           <!-- End of Menu -->
                        </td>
                     </tr>
                  </tbody>
               </table>
            </td>
         </tr>
      </tbody>
   </table>
   <!-- end of header -->
</div>
<div class="block">
   <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f4f5" st-sortable="bigimage" id="backgroundTable">
      <tbody>
         <tr>
            <td>
<table class="mceItemTable" style="" data-mce-style="" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff" align="center"  width="612">
	<tbody>
		<tr>
		<?php
		$showMidColumn = true; 
		foreach($firstTwoDeals as $deal) 
		{
			$partialDescription = strip_tags($deal['Deal']['description']);
			$partialDescription = str_replace(array("\n"), "", $partialDescription);
			if(strlen($partialDescription) > 200)
			{
				$partialDescriptionArray = explode(" ", $partialDescription);
				$partialDescription = "";
				foreach ($partialDescriptionArray as $pditem)
				{
					if($partialDescription == "")
					{
						$partialDescription = $pditem;
					} else {
						$partialDescription .= " ".$pditem;
					}
					if(strlen($partialDescription) > 190)
					{
						break;
					}
				}
				$partialDescription .= " ...";
			}
			
			$discount = (($deal['Deal']['discount_type'] == Deal::DISCOUNT_TYPE_PERCENT)?$deal['Deal']['discount']."%":number_format((($deal['Deal']['discount']/$deal['Deal']['regular_price'])*100),2)."%");
			
			//$viewButtonImage = cr("cmsConfig.Backend.siteUrl")."/deals/img/deal_newsletter/deal_news_".$deal['Deal']['deal_type'].".gif";
			$viewButtonImage = cr("cmsConfig.Backend.siteUrl")."/deals/img/deal_newsletter/view_deal_button.png";
			$dealViewUrl = cr("cmsConfig.Backend.siteUrl").$deal['Deal']['viewUrl'];
			?>
			<td style="border-bottom:1px solid #cccccc;" data-mce-style="border-bottom: 1px solid #cccccc;" align="center" bgcolor="#FFFFFF" valign="top" width="297">
				<table class="mceItemTable" border="0" cellpadding="0" cellspacing="5" width="297">
					<tbody>
						<tr>
							<td style="padding-left:14px;padding-right:13px;" data-mce-style="padding-left: 14px; padding-right: 13px;" align="left" valign="top">
								<div style="height:30px;overflow:hidden;margin-top:15px;" data-mce-style="height: 30px; overflow: hidden;">
									<a style="text-decoration:none;font-weight:bold;font-family:Arial, Helvetica, sans-serif;font-size:14px;color:#333333;text-decoration:none;" href="<?php echo $dealViewUrl; ?>" target="_blank" data-mce-href="<?php echo $dealViewUrl; ?>" data-mce-style="text-decoration: none; font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333;"><?php echo $deal['Deal']['title']; ?></a><br data-mce-bogus="1">
								</div>
							</td>
						</tr>
						<tr>
							<td align="center">
								<table class="mceItemTable" border="0" cellpadding="0" cellspacing="0" width="257">
									<tbody>
										<tr>
											<td align="left" height="174" valign="top" width="257">
												<a style="text-decoration:none;" href="<?php echo $dealViewUrl; ?>" target="_blank" data-mce-href="<?php echo $dealViewUrl; ?>" data-mce-style="text-decoration: none;">
													<img style="border:1px solid #cccccc;display:block;" src="<?php echo cr("cmsConfig.Backend.siteUrl").$deal['Deal']['image'] ?>" alt="<?php echo __('Deal'); ?>" data-mce-src="<?php echo cr("cmsConfig.Backend.siteUrl").$deal['Deal']['image'] ?>" data-mce-style="border: 1px solid #cccccc; display: block;" border="0" height="170" width="255">
												</a><br data-mce-bogus="1">
											</td>
										</tr>
										<tr>
											<td align="left" width="257">
												
												<table class="mceItemTable" bgcolor="#CCCCCC" border="0" cellpadding="0" cellspacing="1" width="257">
													<tbody>
														<tr>
															<td style="border-right:1px solid #a9a9a9;" data-mce-style="border-right: 1px solid #a9a9a9;" align="center" height="27" valign="middle" width="50%">
																<span style="font-family: Arial, Helvetica, sans-serif; color: #333333; line-height: 1em; font-size: 10px;" data-mce-style="font-family: Arial, Helvetica, sans-serif; color: #333333; line-height: 1em; font-size: 10px;"><?php echo __("Discount");?><br>
																	<strong style="font-size:13px;" data-mce-style="font-size: 13px;"><?php echo $discount; ?></strong>
																</span>
															</td>
															<td align="center" height="27" valign="middle" width="50%">
																<span style="font-family: Arial,Helvetica,sans-serif; color: #333333; line-height: 1em; font-size: 10px;" data-mce-style="font-family: Arial,Helvetica,sans-serif; color: #333333; line-height: 1em; font-size: 10px;"><?php echo __("Price"); ?><br>
																	<strong style="font-size:13px;" data-mce-style="font-size: 13px;"><?php echo __("$".$deal['Deal']['finalPrice']); ?></strong>
																</span>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
						<tr>
							<td align="right">
								<table class="mceItemTable" border="0" cellpadding="2" cellspacing="0" width="270">
									<tbody>
										<tr>
											<td align="left" valign="top" width="145">
<a href="<?php echo $dealViewUrl; ?>" target="_blank" data-mce-href="<?php echo $dealViewUrl; ?>" data-mce-style="text-decoration: none;" style="background-color:#0db9ea; border-top-left-radius:4px; border-bottom-left-radius:4px;border-top-right-radius:4px; border-bottom-right-radius:4px; background-clip: padding-box;font-size:13px; font-family:Helvetica, arial, sans-serif; text-align:center;  color:#ffffff; font-weight: 300; padding:10px 15px;text-decoration:none;"><?php echo __("View"); ?>
												</a>											</td>
											<td align="left" valign="top" width="117">
											
													<!--<img style="display:block;" src="<?php echo $viewButtonImage; ?>" alt="<?php echo __("View"); ?>" data-mce-src="<?php echo $viewButtonImage; ?>" data-mce-style="display: block;" border="0" height="29" width="107">-->
													<br data-mce-bogus="1">
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
					</tbody>
				</table>
			</td>
			<?php if($showMidColumn == true) { ?>
			<td width="18">
				&nbsp;
			</td>
				<?php $showMidColumn = false; ?>
			<?php } ?>
		<?php } ?>
		</tr>
	</tbody>
</table>
 </td>
         </tr>
      </tbody>
   </table>
</div>